package lab02.test11;

public class Rectangle implements Printx {
    //属性：边长
    double length;
    double wide;
    double area;
    double perimeter;
    //行为：求面积、求周长
    double area(){
        return length * wide;
    }
    double perimeter(){
        return 2 * (length + wide);
    }
    @Override
    //printMyWay()方法能显示矩形的边长、面积和周长。
    public String  printMyWay() {
        return "长：" + length + "宽：" + wide + "面积：" + area() + "周长：" + perimeter();
    }
}
